package org.itzixi.rabbitmq;


import lombok.extern.slf4j.Slf4j;
import org.itzixi.pojo.netty.ChatMsg;
import org.itzixi.utils.JsonUtils;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

import java.util.Objects;

//@Component
@Slf4j
public class RabbitMQConsumer {


//    @RabbitListener(queues = {RabbitMQConfig.TEST_QUEUE})
//    public void watchQueue(String payload, Message message){
//
//
//        String routingKey = message.getMessageProperties().getReceivedRoutingKey();
//        log.info("routingKey:{}", routingKey);
//        if (Objects.equals(routingKey, RabbitMQConfig.ROUTEING_KEY_IMOOC_WECHAT_TEST)){
//            String msg = payload;
//            log.info("msg:{}", msg);
//            ChatMsg chatMsg = JsonUtils.jsonToPojo(msg, ChatMsg.class);
//            log.info("chatMsg:{}", chatMsg.toString());
//        }
//
//    }

}
